package com.joker.product.controller;

import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.joker.common.log.annotation.Log;
import com.joker.common.log.enums.BusinessType;
import com.joker.common.security.annotation.RequiresPermissions;
import com.joker.product.domain.PmsSpuInfo;
import com.joker.product.service.IPmsSpuInfoService;
import com.joker.common.core.web.controller.BaseController;
import com.joker.common.core.domain.Result;
import com.joker.common.core.utils.poi.ExcelUtil;
import com.joker.common.core.domain.Result;

/**
 * spu信息Controller
 *
 * @author joker
 * @date 2025-01-14
 */
@RestController
@RequestMapping("/spuInfo")
public class PmsSpuInfoController extends BaseController
{
    @Autowired
    private IPmsSpuInfoService pmsSpuInfoService;

    /**
     * 查询spu信息列表
     */
    @RequiresPermissions("product:spuInfo:list")
    @GetMapping("/list")
    public Result list(PmsSpuInfo pmsSpuInfo)
    {
        startPage();
        List<PmsSpuInfo> list = pmsSpuInfoService.selectPmsSpuInfoList(pmsSpuInfo);
        return getDataTable(list);
    }

    /**
     * 新增spu信息
     */
    @PostMapping("/{spuId}")
    public Result up(@PathVariable Long spuId) {
        pmsSpuInfoService.up(spuId);
        return Result.success();
    }




}
